<?php
/**
 * 用户配置文件
 */

// 发布文章随机时间间隔
$interTimeMin = 20;    // 秒 3分钟
$interTimeMax = 25;    // 秒 7分钟

// 用户列表配置
$userList = array(
    'szjznkyy' => array(
        'userName' => 'szjznkyy',
        'userPass' => 'h12345678',
        'hosType' => 'jznk', //获取医院信息
        'columnList' => array( //栏目信息
            'mark' => 'bfzy_jznk_%',  //文章的类型
            'key' => 'szjznkyy/szjznkyy.txt',  //标题的文件
            'img' => 'szjznkyy/szjznkyy_img.txt' //图片文件
        )
    ),
);


//栏目 及其对应的 提交参数
$columnList = [
    #行情管理
    "my" => [
        'url' => 'http://www.shanghui5.com/member/my.php?mid=7',
        'param' => [
            'action' => 'add',
            'mid' => 7,
            'itemid' => 0,
            'color' => '',
            'forward' => 'http://www.shanghui5.com/member/my.php?mid=7&status=3',
            'post' => [
                'title' => '',
                'catid' => '27489',
                'content' => '',
                'areaid' => '233',    //广东深圳的areaid
                'sync_sina' => '0',
                'sync_qq' => '0',
            ],
            'submit' => '提交'
        ],
    ],

    #公司新闻
    "new" => [
        'url' => 'http://www.shanghui5.com/member/news.php?',
        'param' => [
            'action' => 'add',
            'itemid' => 0,
            'forward' => 'http://www.shanghui5.com/member/news.php?action=index',
            'post' => [
                'title' => '',
                'style' => '',
                'content' => '',
                'typeid' => '0',
            ],
            'submit' => '提交'
        ],
    ]
];


// 先获取医院信息
$csvTabName = array(
    'hosName' => '医院简拼',
    'HospitalCity' => '医院地区',
    'HospitalName' => '医院名称',
    'HospitalFullName' => '医院全称',
    'HospitalAddr' => '医院地址',
    'HosAbbrAddr' => '医院短地址',
    'HospitalTel' => '医院电话号码',
    'HospitalQQ' => '医院QQ',
    'HospitalWecha' => '医院微信',
    'DoctorName' => '医生姓名',
    'operHours' => '工作时间',
    'mobileSite' => '手机站地址',
    'swtid' => '商务通ID'
);

// 获取 CSV内容
$jsonArr = csv2json(dirname(__FILE__) . '/hosTag.csv', $csvTabName);
$hosRepKey = array();
foreach ($jsonArr as $value) {
    // 分解医生信息
    $value['DoctorName'] = explode('/', $value['DoctorName']);
    // 分解手机站地址
    $value['mobileSite'] = explode('/', $value['mobileSite']);
    $hosRepKey[$value['hosName']] = $value;
}
